remove commentted line and implemented JSLint suggestions
added return if query is not available in doSearch function
removed instanceof check for dialog and deleting dialog object after closing it
removing no-results class as soon as user start typing and added Error message display for no result