debounce for canvas