the position of cursor is properly set