fix debug logging