Correcting issue in case no end node set.