Fix a bug in the sleep time