fix check_visibility