fixed list freeing bug