ECMS-5717: Problem when delete many nodes with the same title

Fix description:
 - Fix the condition to check for child node