fixed some leaks