resolved null reference in open function