improved diagnostics