[BUG] Fix bug connecting to remote.