added debounce and throttle