improve diagnostics