fix bug when transform times out upserting document