added resize function with debouncing