small change to update function