fix duplicate free of json