added bounds checking in strarray_set