make compatible with rails 4