i am currently working with a js function that gives an html input field an autocomplete feature. This is working fine, however it only works for the first word a user gives