Fixed a bug in visibility