forever loop fixed in file chooser