added onEnergySend hook