changed __dirname to CWD passes tests and deletes temp file [Thanks TJ!]