fixed some bugs with player ai