fixes autocomplete crash bug