Sanitate resource dir similarly when adding and removing it to ensure removing works properly.