validation in duplication of codes