made pagination work