correcting path problem for graphs scripts