put the cursor in the right place