GetCurrentDeviceState fix