modify error handling for definition checker