function for recording cd history