fix resize behaviour