fixing debug logging