Fix bug of AI