does this function meed to be recreated every time the debounced function is called?