now  modal has correct z-index, now ai modal closes again on ai change