added debounce and distinct