moved motor checking around