Add while loope incremental counter

While loop will last forever if there is no increment in the counter.