map/reduce fix