fix a bug related to $remote_path