Code for debug mode