finally got the resize event working