added a resize event listener