fix url pattern error, use set's discard instead of remove