add save option for _regenerateOptions and remove debug code