fix segfault from delete uninitialized pointer