Preserving variable contents in bash : I have the following code:

     WD="$(pwd)"
     echo $WD
     cd
     echo $WD

Say I am working under /home/USER/sandbox, the output of the above is:

     /home/USER/sandbox
     /home/USER

Why does WD not preserve its value? Is there any way to get it to preserve its value?