fix $$display math$$ matching of second closing $