make update_cd a background job and fix script run in another machine