Added cleanup of tempfiles and added unique task id to temp files, to avoid weird stuff..