add upgrade and downgrade support