Fixed erroneous query