added example for afterDestroy