sleep functionality implemented