Fixed the logic matching the unique code