fix bugs in smart-ai