Add postdestroy hook