fixed slight issue with freeing a node