take optional stream arg