added on_destroy function to liven