Moving debug message behind variable test