modules and while loop fix