fix cpdir bug, invalid path