implement D-tor