fix rails 4 bug