fixed code causing bad file paths