adding prevNode