fixed pagination problem