cleaned code for filelogger