Modified error statement to use logger.