fix energy computation forcompound case