added exception to error logging.