Check if pagination is needed