make cwd variable in build functions local