Fixed bug updating linked list