modify to use relative path location
replace basename with dirname
fixed missing slash (let's hope this works at some point