removed sleep funtion and used exec