update the auto complete function