fix resource update logic