Added sleep functionality