debug mode added