added visibility check