fix a switch and for ai's data