The AI shouldn't automatically calculate moves after every move that's written to it. Instead it should accept moves for both players and have a command to make it start looking for a move.
This way it's also possible to use the AI for analytical features like calculating the chance of a player winning.