fix incorrect visibility update