Fix resize behaviour