fix a performance issue when removing projects