added sleep(3) to prevent full CPU usage