fixed a pointer that caused crash on exit