Makes compatible with Rails 4