Fix to rails 4