fixed some bugs related to auto add