logging the exception