added energyinfo support

added error check