Fix memory leak crash