adding pagination on main page