fix bugs of hdfs write