fix erroneous use of vector::erase