added the code to copy cached copy to output dir