fix a bug where completion fails when one of the -cp doesn't exists