move sleep for debugging
i think exhausting the generator was causing a problem