Properly set max page, do not hard code to 10.