Guard against undefined done function