Do you think putting the file paths into a variable might help with the problem? Try googling the error you get, that's how I find ways to solve errors. For example, when I google your error, I got this page which may or may not help your problem:
https://stackoverflow.com/questions/...eference-error