added oldWidth and oldHeight to resize event