fixing a bug in runCFG