Fix for updated cp code