functionality working with pagination