added support for cmdline debug flag