fixed 'method not found' exception in chrome

During the autocompletion call javascript may throw an exception, because method 'getAllWords' is not found in an object. This is caused by the for loop (see diff) not checking whether the child is an actual property of the object 

tested in chrome (v28) and firefox (v22)