Fix save and update bug