Fixed bug in AI process call. AI still needs to be debugged