fixed client write task in js