Fixed bug of adding closing line twice