add test code for the safecopy