added some code for timer interrupts