cursor now moves to correct location