added interface to toggle debug