made dynamic paging work n stoff with ruby helper function