deteting improper graph, putting the correct one