implemented interrupt handling