added the sleep try catch