update across study query

added try catch of index outofbounds error