fix end lines