fix error assertions