corrected bug of duplicate lines