fixing bug in error-testing function assert