added interrupt handling