improved debounce