use max total pages instead of posts