Fix error hiding modal