modified stream decorator to handle functions with multiple arguments