modify writer and protocal