Add debounce function