Fixed bug with linked list