fix compatibility with rails 4.0