an error catcher
fixed up a new bug in trimmedTargIndex