Changed working directory to /tmp. Fixed cp stat errror issue.