Fixing javascript error in IE8 while selecting the item from autocomplete menu, fixed #496