resize and updatedata methods