Added a check for the correct interrupt rather than assuming its the timer. This will be important when other interrupts are enabled.