catch errors with autocomplete