fixed smartgrid bug, thanks Anthony