Fixed: Attribute error in open function