fix global leaks