added debug mode
added debug mode