changed from grammarErrorAtPos to errorAtPos