bug in AI fixed