Fixed compatibility bug with Rails 4.1