added check for cd resource length