fix layout issues when resizing