Changed usleep for sleep