added slight time delay in while loop.