fixes #214: fix the bug that If the version is invalid, cortex build will fail