added check for valid log header/number