compound unique index and fixing code