fix space leak