helper method to get pagination offset