fixed 'done' criteria on context to match actual behavior