added clear_diagnostics