removed writeRemotePrefix