solve compatibility problems with rails 4