adding resize function