motor power switching added