fixed the cursor overwriting the same  linewhen it should move to a new line