if trimmed query is empty then don't append question mark