adding done function