fix eroneous query