fix bad operation ordering for window allocation