change the logic of can_upgrade
Merge pull request #109 from michaelnsj/3.0

Merged.