Added query empty condition