Browser window closes after opening