Enhanced to save captured files.