this should also fix the issue where the cursor position sometimes ends up at the wrong position after you stop moving