reset next element of node to null when delete heading node