fixing rails 4 bug