change error logging when exception