Fixing update logic