fixed updating bug