Solve Bug: file name variable overwritten