don't sleep forever! use 'usleep' instead of 'sleep'