finish the mining backend