listen to the resize event too