Fix a bug of AI