Detecting whether a device is currently running