add function for motor