updating findChildrenId to use distinct instead of stream.