add pagination logic for selects