add code for check the remote path exists