fixed bug where device wasn't being turned off.