Removed duplicate or invalid IDs