changed remove() to only throw an exception if the file existed but was not removed