fixed spelling mistake; swapped loop for sleep