added ability to enable and disable debug