def METHOD_NAME(storage_dir,err_id):
    """Return the name of the output file giving preference to the newer version
    Parameters
    ----------
    storage_dir: str of storage directory
    err_id: str err_id
    Returns
    -------
    pipeline_output_json: str filename
    """
    pipeline_output_v2_json = os.path.join(storage_dir, "EPHYS_FEATURE_EXTRACTION_V2_QUEUE_%s_output.json" % err_id)
    pipeline_output_v1_json = os.path.join(storage_dir, "EPHYS_FEATURE_EXTRACTION_QUEUE_%s_output.json" % err_id)
    # if the input_v2_json does not exist, then use input_v1_json instead:
    if os.path.isfile(pipeline_output_v2_json):
        pipeline_output_json = pipeline_output_v2_json
    else:
        pipeline_output_json = pipeline_output_v1_json
    return pipeline_output_json