fixes #48: fix a bug that If ranges is specified, there will be undefined versions