fixed open function