pagination display on top js bugfix