on_exit replaced with in_exit2