Fixed time sleep issue