fixed vector memory leak