fixed permission problem on temp file