fixing illegal arg exception which was caused by a attempting to sleep for a negative amount of time