added file logging to main