use Rails.logger.debug insetad of puts