added pagination control