fixed a bug in linkedList - init head pointer properly