testing function for detecting foreign strings