improve getDiagnostics