fixed bug in cp