finsh function resize