debounce logic