check if array index ocsid is set before accessing it