fixed flatMap