Fixed AI crash