Fix catching invalid type when deleting a folder
use authentication files