Added support for attaching and detaching interrupts