fixed a bug where pagination is in negatives