Resolving unique constraint