explicitly raising error when a key can't be inserted