added interrupt to terminate