before removing linked list