fix on pagination, and add a per_page input field