added pagination to models