Fix rails 4.1.6 compatibility issue