improved debug macro