Fix for error when logging error