trimming query name