removed stray error handler and moved file logging.