Added logging for error cases