use logger.debug instead of puts for logging