CFY-1071 changed if-statment location to run only in debug mode.