resize logic done