prevent memory leaks.