improved diagnostics and logs