add debug functionality