handle interrupt and make add closed flag to miner