fixed null pointer exception in debug logging