Finish update function