implementing topbar and enhancing pagination