Added a call in order for each class finish its resources once the simulation is over.