Changed the debug functionality