fixed a bug in the common ai