Fetch a single document fix

This is a fix for the document function - so the results are now passed back from the query