initial recording functionality