fixed minor bug with linked list deletion