safe object destruction