fixed npe on debug logging