use Rails.logger instead of puts!