Minor logic changes
Use our own API for visibility check. More reliable.