modified code to delete old data folders