fix while loop to limit be set at 100