added ifdef around debug check