kill old window open function