fix cache folder removal
add more removal precautions