added irq handling