correction to update logic