remove unused ids