fix  return value in write context