implemented basic interrupt handling