added pagination support