code modernization
added an error message to an assertion