in TypeChecker, added an option to pass an error message