Make sure to close the channel if the upgrade fails