began to fix the update logic