Move sed command to after the file is created.  Duh.