Update the end pointer in the linked list