Update SinglePid.js

added file write