adding support for older versions of rails