linked list bug fixes