changed logic from  delete stored files to create temp ones.