added error check for loading packed grammars