Changed to no longer sleep the main Thread