Fixes bug in the remove part of the cdr script