fixed bug in cdr