adding code to avoid sleeping through the start of gametime