Fixed small bug in pagination