Adding a custom debug handler