add energy calcuation after upgrade