fixed the pagation bug