Fixed rails 4 compatibility problem