wrapped debug cout in debug checking