Added IsVisible check in queries