added custom assertion and verbose debug messages