Using debounce instead of throttle