fixing bugs with new write pipeline