Fix the linked list pointer wrong assignment issue