implementation of avlSleep() updated