better handling of curses when job finishes