Fixed attempt to modify immutable array