fixes several versions upgrade bug