Controlla che done diventi effettivamente true quando termina il programma.