Trying to get property 'motor_id' of non-object