Fixing small bug in ai