changed sleep time and added a status variable