dirty hax to make this work with Rails 4