fix the program dump state finally, and change the preview state