Fixed the issue where the search term having a space at the end or in the middle of the word would crash the app.