I added assertion code only in DEBUG version.