filter in terms of flatMap