bug fix of AI