Small error in grabbing resource array value; still get error when dim > 2