Fixed error for rails 4