update object and array