Fixed duplicate key exception