Fixed a bug, should detect sleep