Fix: don't try to write to a closed AI