fixes to after_destroy hook