Added environment check for debug message