Add logging for error case