added framework for recording.