Made pagination work