add batch update feature, bug have duplate code