quick bug fix in resize function