resize function
resize fun