fixed write context