added an end_request to the db flush