Fix for Rails 4