checks if children has children - solved issue