Add update function and its dependencies