adapted for serial recording procedure; cleanup needed