add exception guards in critical barrier path