added a limiter for while loop.