fix visibility check possibly related to #728