fixed bug with undo remove and test