updated with pagination