made the pagination much more compatible with older versions of ruby