added runtime error handling for non-unique set elements