Make pagination work with tabs