Corrected bug with unique validation