Move ``set_owner`` call to ``before_flush`` phase