added debounce on resizing
event registration changed to addEventListener