_processQueryResults now does a shallow copy of the data. Also renamed doc to docName (or d inside messages)