crash fix for memory leak