fixed nasty ai glitches