fix smartgrid bug by the change of size method