use flow instead of stream in function search