update resize function

still have bug:
clear();
Again
update reset. seems work good