modified 'done' handling