Drop sleep() to 1, and see if that works.