added timer to reset device state, added time threashold to device reaction