fixed data loss problem in map-reduce