fixing long-broken update function