performance tweaks, add resize event listener