fixed AI hang