Fix recursion in update logic