write context fix