error condition for code to redirect + remove debug mode: