shitty while loop fix