Add shutdown function to remove files on shutdown