functin moveCursor correction