make sure that the dir exists before trying to remove