MINNEAPOLIS (AP) — A Minnesota man convicted of conspiring to join the Islamic State group is being allowed to return to a halfway house after he was re-arrested last month for watching a news documentary on terrorism.

A federal judge on Tuesday decided Abdullahi Mohamud Yusuf violated terms of his release when he watched a CNN documentary about the Islamic State group.

But the judge allowed the 21-year-old to return to a halfway house instead of prison, telling Yusuf he needs to continue to work on reforming himself

Yusuf was among nine Minnesota men sentenced last year for conspiring to join the militant group in Syria. Yusuf cooperated with prosecutors and was sentenced to time served and 20 years of supervised release.

Under conditions of his release, he isn't allowed to watch extremist material. Yusuf told U.S. District Judge Michael Davis he didn't know a news program was a violation.