fix usage of std iterator erase