Last line repition bug fixed