moved procs behind DEBUG constant definition, to avoid compare with undefined