Add debug enable/disable and function