make hide only occur if success