made erase work for certain cases