added logic to search when user presses the enter key