make ai not crash when trying to select a non-optimal legal move