fileshere should not have been in a while loop