ensure that all context are closed and destroy properly.