fix empty query finally