added update function, needs update_local