Set some variables to "local" and fixed the find regex