C++ I am trying to delete link list but it get errors when i tried to delete head or node in the middle :  I know where is wrong but I don't know how to change it. Help, please! The only working is this **(CurrentNode->next == NULL)** if else case  the other doesn't. What can I do?
```void Restaurant::deletereservation()
{
    string name;	    
    cout << "Enter name of customer that you want to delete: " << endl
    << "Name: ";
    cin.ignore(80, '\n');
    getline(cin, name);
    ReservationNode *nodeIn = head; 	      
    ReservationNode *CurrentNode = head->next;  
    while ((CurrentNode != NULL) && (CurrentNode->Name != name))
    {
    	nodeIn = CurrentNode;
		CurrentNode = CurrentNode->next;
    }
	if (CurrentNode->Name != name){
		cout << "Error!!!" << name << " is not found.Cant be deleted if there is no such person." << endl;
	}
	else{
		if (nodeIn == head){
			CurrentNode = head->next;
			CurrentNode = head;
			delete nodeIn;			

		}
		else if(CurrentNode->next == NULL){
			nodeIn ->next = NULL;
			delete CurrentNode;				
		}
		else{
			nodeIn -> next = CurrentNode->next;
			delete CurrentNode;	
		}		
	}
    
}```
