Fixed toggling to check if visible or not