fix logger updating last line when not supposed to