bug fxes, added pagination