changed pickle method