Fix map reduce function for user model
Merge branch 'fix-map-reduce-func'