modified query empty value handling