slightly modified assertion code