fix write in map stream