cleaned up memory leaks