Why is the visibility check necessary here?