fix bug in save pickle file