checking for memory leaks