Fix for working with rails 4