fixing autocomplete bug in adddialog box