some logging and diagnostics