added pagination and ocunt support