fix broken sleep() call