minor readability tweak in if/else, re-added sleep

to prevent saturation and throttling issues