cache stream before callback