Solved empty LinkedList error