fix all pointer problems