implementing debug mode