improved ui, fix bugs on ai