Changing detect, and fixing location error with preindex