Updated ISR code