fix issue 162, support debug option