fixed a bug in pagination, next button was grayed out