max_page pass as a param