Fix a bug for tag autocomplete