added ability to log to a file