Modify the update logic

as title , i have modify the updatelogic