add a set to check duplicate