check return code on copy and deletes; fix copy to work always by
writing to "profile" instead of "temp"