handle close task request.