fixed AI stuff