add test for deleteRemoved and fix bug