getcwd

added os.chdir(cwd) to prevent creation of nested blockdirs in daemon mode run locally.