added diagnostics on/off