Modified external interrupt code