add logic for range spinner