adding debug mode