Adding debug mode support