fixed a bug on StringRecognizer