define function resize