fixing intend on the resize function