Change visibility check not to use ':hidden'