fixes the bug that `cortex profile add` throws; fixes #322
fixes the bug that throws when cortex install xxx outside a repo; fixes #232