end last session before constructing query for the new one