fixing bug in assert