fixed exception with AI