fix handleUpgrade() signature