fix trap handling status reg management