Destroy cursor after flush