fixed the update bug