added an overloaded method of createWeakSet