uncomment debug printf and fixes warning
repalce compile time option by runtime