Added resize function