Add debug functionality