pagination mechanism fully working