removed unneeded if-then.
added slight sleep in loop.