Modify autocomplete cache&fix some bugs