clean up resource.