close pickle_file. remove old functions