DetetorMessenger and sensitive detector

Hi everyone,
I have a problem using the DetetorMessenger to manage the Geometry . When i using the class of DetectorMessager to change the size of the geometry (not the sensitive detector),and then and i can not get any energy using“G4double edep = aStep->GetDeltaEnergy();”in SD.
G4cout<<"edep = "<<edep<<G4endl;
All is 0!

Can someone tell me why and how to fix this?

Thanks in advance.