added some diagnostics