attempt at ai bug fixes