open function implemented