update resize logic