add uniqueness validation on reference and badges
fix validate uniqueness on reference and badges