Added debounce to resize and scroll event