fixed for Rails 4