changed update logic