parcially solved the issue with the correct closure of all the processes when the server dies.