add flatMap to Foundation