function that deletes old files now runs as separate python script instead of a thread