fix upgrade/install bug #218

fix upgrade/install bug closes #218