Added a null check on keywordStr