Change from map to flatMap
Merge pull request #2541 from wsargent/fix-doc-ws-flatmap-future

Fix doc ws flatmap future