Fix modal not being removed