Fixing Order of Insertion of Grill Finished Queries

Moving the insertion of the query into DB after Query has been closed by Driver.