added working replace stream