fix some leaks