To be compatible with rails 4