find the last element of linked list