Function to toggle autocomplpop