Added flow update function