Solve writing output filename