making engine compatible with rails 3