improve layout of query form
if a space is within query, remove sort argument