Updated ISR routine