Return result of query as variable

Get rid of the } before the final return and add }) after the final return line