added option to turn on/off debugging logs