fix bug in grammar for complex string