As I understood, this new assignment makes sense only for call from virtual_cwd_deactivate(). May be it makes sense to move it there.