Fix visibilityChange listener