modify debug_sess to have except