fix the bug when windows change small the layout in a mess