why not using directly the return value of the update function ?