an alternative if you having with re-writing code
i can re-write it for you that it searches the folder in which the file is placed

would that be better?