Wired $windowInstance.opened when window is activated

Now use $windowInstance.opened instead of activate