overidden resize function