got update function to work