update the ui when resize.