added a few safety mechanisms to ai creation
still hasn't fixed hanging bug