Added the validaterpd step to the GenerateRpd subroutine.
added the unlink