fixed bug with solenoid toggling