fixed errors during cleaning the graphs at generation