bug on energy computation