Modified to avoid error on generating more than one line.