AI: this fix still does not work, the visualization part of the AI will now return a new AI data structure instead of modifying the old one in place.