bug fix in get_study_ids