BERLIN (AP) — German authorities are trying to determine whether four German women, including a teenager, detained in Iraq on allegations of sympathizing with the Islamic State group can return home.

They include 16-year-old Linda Wenzel, who ran away after converting to Islam and was found by Iraqi troops in Mosul last month.

A spokesman for Germany’s Foreign Ministry says diplomats recently visited two of the women in Baghdad and determined they are “doing well given the circumstances.”

Martin Schaefer said Monday that Germany is obliged to provide the women with consular assistance and wants to “find a good solution that corresponds to their interests” including return home if they wish.

But he added that “we have to ensure that no threat is posed by the four after a possible return to Germany.”