Fixed The Query Issues