added a test to ensure duplicate key errors are raised.