Fix bug with undeployment

I obviously cannot chdir into a path that has already been destroyed by deploy's undeploy