Fix for national characters

Had trouble with exception that was caused by national characters in the term. This fix solved the issue for me.