fix for upgrade and attack