fixed rails 4 compatibility