fix bug with remote file.