after deleting pointers set them to NULL