added used ids tracking