fixed a bug in generating text for random graphs