reshape window properly