fixed the private method check grammar to a public one