fixed pagination related issues