fix buggs with termLine