update logic