fix done function