checking for memory leak