working AI, still errors on exit