Corrected dir name and redirected sed to tmp file