added file_open function