created sleepState boolean for sleep function