Fix modal window replacement