updated version for will_paginate