add a sleep() to sessions, and remove some dead code