next previous functionality with tabs