fixed the null value bug in autocomplete