fixing an error in ai code

because errors are bad